-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ActionMenu<Scan>): ds-437 add download report button #513
base: main
Are you sure you want to change the base?
Conversation
npm run start:using-server will serve the development UI properly wired to a running instance of quipucords server. Default configuration points to quipucords-installer defaults, and can be customized with QUIPUCORDS_SERVER_* variables.
The button shall only be enabled when the scan is completed.
Thanks for adding this @bruno-fs. Let try to get this one in for the v2 release, since it addresses a blocker issue. |
After sleeping on it, I believe we could test this workflow directly in the camayoc, given that we were missing the step to complete the standard workflow for scanning. Thoughts, @mirekdlugosz & @ruda ? |
}, | ||
{ | ||
label: t('table.label', { context: 'download' }), | ||
disabled: scan.most_recent?.status === 'completed' ? false : true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to use the same "can be downloaded?" condition here and in showScansModal.tsx. Maybe it should be put in helpers, since it would be used in two files.
(I am not saying the other condition is better than this one; I am saying both places should use the same condition, whichever that is)
const downloadReport = useCallback( | ||
async (reportId: number) => { | ||
async (reportId: number | undefined) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I hate these lax signatures. downloadReport
should download report and gracefully handle errors in environment outside of our control. If you don't have id of report to download, don't call downloadReport
. TypeScript can tell if variable is optional, we should use that information.
The button shall only be enabled when the scan is completed.
What's included
Includes a dropdown button on scan row kebab for downloading reports.
Notes
report_id
(due to a bug/edge-case on the backend?). a client-side error will be thrownExample
Kebab for scans in progress
...and for completed ones
On download completion, an alert should be displayed. Same shall happen on errors, but that's harder to test without
monkey-patching the server
...
Updates issue/story
DISCOVERY-347